home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 26
/
Cream of the Crop 26.iso
/
doom
/
suckmods.zip
/
SUCKMODS.ZIP
/
suck05
/
helpers
/
charstoquakec.c
< prev
Wrap
C/C++ Source or Header
|
1997-05-09
|
529b
|
28 lines
#include <stdio.h>
int main(int argc, char ** argv)
{
unsigned char s[1024];
short sh;
int i=0;
int inverse=0;
if (argc>=2) inverse=1;
printf("Enter a string to compile: "); fflush(stdout);
gets(s);
while (i<strlen(s))
{
if (inverse) { if (isalpha(s[i])) s[i]+=128;
if (isalpha(s[i+1])) s[i+1]+=128; }
sh=s[i];
sh|=s[i+1]<<8;
if ((i+1)==strlen(s))
printf("\tWriteByte(MSG_ONE, %d);\n", sh&0xff);
else
printf("\tWriteShort(MSG_ONE, %d);\n", sh);
i+=2;
}
}